package main

import "fmt"

/*
* Author: JacksonCoder
* CreateTime: 2025-10-23
 */

func main() {
	println("hello go")

	a := 10
	println(a)

	var a1 int = 1
	println("a1 ", a1)
	a1 = 20
	println("a1 = ", a1)

	var a2 int = 30
	println("a2", a2)

	var a4 = 40
	println("a4 ", a4)

	b := [3]int{1, 2, 3}
	for index, value := range b {
		println("Index:", index, "value:", value)
	}

	c := []int{1, 2, 3, 4, 5}
	println(c)
	println(c[0])
	println(c[1])
	println(c[2])

	d := map[int]string{}
	d[1] = "hello"
	d[2] = "golang"
	d[3] = "hi"
	println(d)
	println(d[1])
	println(d[2])
	println(d[3])

	for i := 1; i <= 10; i++ {
		println("i = ", i)
	}

	today := 1
	if today == 1 {
		fmt.Println("今天是周一")
	} else {
		fmt.Println("今天不是周一")
	}

	grade := "B"

	switch grade {
	case "A":
		fmt.Println("优秀")
	case "B":
		fmt.Println("良好")
	case "C":
		fmt.Println("及格")
	default:
		fmt.Println("不及格")
	}

	// fallthrough
	switch num := 2; num {
	case 1:
		fmt.Println("one")
	case 2:
		fmt.Println("two")
		fallthrough //继续执行下一个
	case 3:
		fmt.Println("three")
	default:
		fmt.Println("over number")
	}

}
